#!/bin/sh

chown -R mysql:mysql /var/lib/mysql

mysqld --initialize-insecure --user=mysql --datadir=/var/lib/mysql  > /dev/null

/usr/sbin/mysqld --user=mysql --pid-file=/var/run/mysqld/mysqld.pid &

sleep 5

mysql < /root/initialization.sql

sleep 5

ps -wef | grep mysql | grep -v grep | awk '{print $2}' | xargs kill -9

/usr/sbin/mysqld --user=mysql --pid-file=/var/run/mysqld/mysqld.pid
